package com.mp.approvalreq.entity;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.plusmoney.util.Utils;

import java.math.BigDecimal;
import java.util.List;

public class Expense {

	private Integer id;

	private Integer companyId;

	private Integer companyInfoId;

	private Integer requestId;

	private BigDecimal totalAmount;

	private String expenseItem;

	private BigDecimal payAmount;

	private String payDate;

	private List<String> attachFile;

	private String remark;

	private Integer type;

	@Deprecated
	private String createTime;

	@Deprecated
	private Integer state;

	private String approvalNum;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public Integer getCompanyInfoId() {
		return companyInfoId;
	}

	public void setCompanyInfoId(Integer companyInfoId) {
		this.companyInfoId = companyInfoId;
	}

	public Integer getRequestId() {
		return requestId;
	}

	public void setRequestId(Integer requestId) {
		this.requestId = requestId;
	}

	public BigDecimal getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}

	public String getExpenseItem() {
		return expenseItem;
	}

	public void setExpenseItem(String expenseItem) {
		this.expenseItem = expenseItem;
	}

	public BigDecimal getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	public String getPayDate() {
		return payDate;
	}

	public void setPayDate(String payDate) {
		this.payDate = payDate;
	}

	public List<String> getAttachFile() {
		return attachFile;
	}

	@JSONField(serialize = false, deserialize = false)
	public String getAttachFileStr() {
		if (Utils.isEmpty(attachFile)) {
			return null;
		}
		return JSONObject.toJSONString(attachFile);
	}

	public void setAttachFile(List<String> attachFile) {
		this.attachFile = attachFile;
	}

	public void setAttachFile(String attachFile) {
		try {
			this.attachFile = JSONObject.parseArray(attachFile, String.class);
		} catch (Exception e) {
			this.attachFile = null;
		}
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getApprovalNum() {
		return approvalNum;
	}

	public void setApprovalNum(String approvalNum) {
		this.approvalNum = approvalNum;
	}
}
